<?php
	$MaThanhVien = $_GET['MATHANHVIEN'];
	$sql = "SELECT * FROM member WHERE MATHANHVIEN='" .$MaThanhVien ."'"; 
	$result = mysql_query($sql);
	$HoTen = "";
	$PassWord = "";
	$Email = "";
	$BirthDay = "";
	$Phone = "";
	if($row = mysql_fetch_array($result))
	{
	$HoTen = $row['IDTHANHVIEN'];
	$PassWord = $row['PASS'];
	$Email = $row['EMAIL'];
	$BirthDay = $row['NGAYSINH'];
	$Phone = $row['PHONE'];
	$Role = $row['ROLE'];
	}
	mysql_close($con);
	}
	//Cap nhat du lieu
	if (isset($_POST['HoTen']))
	{
	$con = mysql_connect("localhost","root","");
	if (!$con)
	{
	die('Could not connect: ' . mysql_error());
	}
	mysql_select_db("qlanh", $con);
	$sql="UPDATE member SET IDTHANHVIEN='$_POST[HoTen]', 
	PASS='$_POST[PassWord]', EMAIL='$_POST[Email]', 
	NGAYSINH='$_POST[NgaySinh]', PHONE='$_POST[Phone]', ROLE='$_POST[Role]' 
	WHERE MATHANHVIEN='" . $MaThanhVien . "'";
	if (!mysql_query($sql))
	{
	die('Error: ' . mysql_error());
	}
	echo "Da cap nhat thong tin thanh vien thanh cong <br/>";
	mysql_close($con);
	}
?>